home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 26
/
Cream of the Crop 26.iso
/
database
/
dg53.zip
/
DGREAD.ME
< prev
next >
Wrap
Text File
|
1997-05-27
|
8KB
|
185 lines
dg - Data-Grep v. 53
Grep is one of the classic tools used in UNIX (and many DOS versions
exist) to search for strings in an ASCII text file, printing the
lines with finds.
dg is like grep but for searching a free-form, ASCII, flatfile
database, printing entire records rather than just the lines containing
the searched-for phrase. Pronounced "dig" as in "digging out data."
dg will search a text file for a given phrase and print all "records"
containing that phrase to standard output. Records are free-form
chunks of text separated by a standard delimiter, normally an asterisk.
Other delimiters can be used. Treating plain paragraphs as delimited
records is an option. See the accompanying .sam sample files for
examples. dg is usable only with plain ASCII text files.
Here is an example piece of a flatfile with a very casual structure:
----------------------------------------------------------------
John Smith BIOLIONS CORP.
44 Main Street
Austin TX
specialties: biochemistry, herbs, football
note: RA conference, 12-96
*
Jane Doe GEOTIGERS CO.
333 S. 44 St.
Atlanta GA
specialties: vulcanism, plate tectonics, GPS, Japanese,
geodesy, x-ray spectra, island formation, collects HO trains.
*
----------------------------------------------------------------
The command: dg tectonics filename
would print all of Jane Doe's record.. and any other records
in the file that mentioned tectonics.
There are numerous search and output options; learn only what you need.
Put commonly used combinations into batch files or aliases.
It is for use in a DOS mode only, either directly or from batch files.
Almost all of the standard UNIX utilities are available in DOS
versions and can be used together in batch files to powerful effect.
dg adds a new tool to that suite.
All major testing has been in UNIX or plain DOS, though
it seems to work fine in Windows 3.1 or Windows 95 DOS modes.
An executable for HP UNIX, compiled on an HP(9000) is included.
---------------------------------------------------------------------
Files included:
dg.exe the dg executable program (for DOS)
dgman the dg manual
dgw.bat for use when searching across multiple files
dgh.bat dg options-help batch file
go.bat runs a set of examples
whatsnew summary of updates with this release
dgread.me this file
sample.dat a demo-baseline file used by go.bat (not for direct reading)
*.sam sample data files used by go.bat
dghp53 the dg executable program (for HP-UX)
---------------------------------------------------------------------
Suggested Quick Familiarization:
---------------------------------------------------------------------
DO THIS: Commands:
-------- ---------
copy these files to a \dg directory
from that directory:
Skim the file minerals.sam: type minerals.sam | more
dig out the records that
mention azurite: dg azurite minerals.sam
Skim the file lincoln.sam: type lincoln.sam | more
run the demo, part1: go dem1
---------------------------------------------------------------------
Skim over the dgman manual file. type dgman | more
---------------------------------------------------------------------
Experiment with extended help: dgh -v
---------------------------------------------------------------------
Run parts of the demo by entering:
go dem1 or
go dem2 or
go dem3 or
go dem4 or
go dem5 or
go dem6 or
go list or
go all (not recommended)
The demo will create a temp.bat, and some .tem files and a zzapfile.
These may be deleted after the demo is completed.
Only advanced users should bother with dem5 and dem6.
The demo is not intended to be all-encompassing. Options
not addressed in the demo are left as exercises for the user.
---------------------------------------------------------------------
Put the \dg directory in your path so that the programs
can be accessible from any directory.
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
NOTICE
---------------------------------------------------------------------
This version of dg is not released to the public domain and is the sole
and copyright property of Pete Marikle. You may bundle this version of
dg with any free or commercial product but you may not sell it
separately. You may, however, distribute dg in the manner of ShareWare,
charging for distribution and handling only.
This version is freeware for personal, individual use. This in thanks
to the spirit of all those who have provided freeware versions of grep,
awk, sed, and all the other UNIX family utilities for DOS users. I've
used dg in batch files and scripts along with almost every UNIX family
utility; some combination has always fit the bill needed.
I disclaim all warranties as to this software, whether express or
implied, including any implied warranties of merchantability, fitness
for a particular purpose, functionality, data integrity or protection.
To repeat, there is no warranty of any kind. The copyright owner may
not be held liable for any damages, including any lost profits or other
incidental or consequential damages arising out of use or inability to
use the software. By using the software, you agree to this.
You are also explicitly cautioned to back up all files used in
association with this software and to satisfy yourself to your own
standards as to its behavior and the suitability of any and all results
to your purpose.
This software and the accompanying documentation are:
Copyright (C) 1996 by
Peter A. Marikle
531 W Mineral Ave #316
Littleton CO 80120
---------------------------------------------------------------------
RELEASE NOTES dg, version 53
---------------------------------------------------------------------
This is the third public release of dg. See the whatsnew file
for differences since version 51. Consider dg a beta version in
all respects. No software I've seen has been bug-free. dg will not be
an exception.
I have used dg for some 5-7 years now, adding options only when I needed
some new behavior. Regression testing is done to discover side effects
of any changes, but no formal "product" level testing has been
warranted. I've run it against dozens of varied "flat" files, and
against files up to about 5 megabytes in size. It has done the things
_I_ wanted done with the kinds of files _I_ use. _You_ must determine
whether it fits _your_ intended usage.
dg has numerous options that can be used together. Most insensible or
unsupported combinations are trapped as errors. Undoubtedly other
combinations will be found that do not behave as someone might expect,
and are not trapped because I didn't see a likelihood they'd be tried in
combination.
Some options and option combinations can be conceptually complex;
results may be what I consider correct, but may or may not be what you
would expect.
It is your responsibility NOT to trust the output until you have tested
YOUR usage to YOUR standards.
Bug reports or recommendations or comments to PMarikle@aol.com
---------------------------------------------------------------------